package com.ciwong.epaper.bean;

import com.ciwong.mobilelib.bean.BaseBean;

/**
 * ${todo} Description of class。
 * <p>
 * ${todo} Detail Description
 * <p>
 * ${todo} Sample Code
 * 
 * <pre>
 * </pre>
 *
 * @author bin
 * @version ciwong v.1.0 2015/7/24 16:26
 * @since ciwong v.1.0
 */
public class MCToken extends BaseBean
{
//    private static final long serialVersionUID = -5335666126585732540L;
    private int iResult;

    private String accessToken;

    private String access_token;

    private long expiresIn;

    private long expires_in;

    private String refreshToken;

    private String refresh_token;

    private String openId;

    private String openid;

    private String tokenType;

    private String token_type;

    private MCTokenApplyInfo applyInfo;

    private String TcpMessageServer;

    private String MessageStoreTcpServer;

    private String MessageStoreHttpServer;

    private long timeDistance;

    public MCToken(String accessToken, long expiresIn, String refreshToken,
            String openId, String tokenType, MCTokenApplyInfo applyInfo)
    {
        this.accessToken = accessToken;
        this.expiresIn = expiresIn;
        this.refreshToken = refreshToken;
        this.openId = openId;
        this.tokenType = tokenType;
        this.applyInfo = applyInfo;
    }

    public int getiResult()
    {
        return this.iResult;
    }

    public void setiResult(int iResult)
    {
        this.iResult = iResult;
    }

    public String getAccessToken()
    {
        return this.access_token != null ? this.access_token : this.accessToken;
    }

    public void setAccessToken(String accessToken)
    {
        this.accessToken = accessToken;
    }

    public long getExpiresIn()
    {
        return this.expires_in != 0L ? this.expires_in : this.expiresIn;
    }

    public void setExpiresIn(long expiresIn)
    {
        this.expiresIn = expiresIn;
    }

    public String getRefreshToken()
    {
        return this.refreshToken;
    }

    public void setRefreshToken(String refreshToken)
    {
        this.refreshToken = refreshToken;
    }

    public String getOpenId()
    {
        return this.openid != null ? this.openid : this.openId;
    }

    public void setOpenId(String openId)
    {
        this.openId = openId;
    }

    public String getTokenType()
    {
        return this.token_type != null ? this.token_type : this.tokenType;
    }

    public void setTokenType(String tokenType)
    {
        this.tokenType = tokenType;
    }

    public MCTokenApplyInfo getApplyInfo()
    {
        return this.applyInfo;
    }

    public void setApplyInfo(MCTokenApplyInfo applyInfo)
    {
        this.applyInfo = applyInfo;
    }

    public String getTcpMessageServer()
    {
        return this.TcpMessageServer;
    }

    public void setTcpMessageServer(String tcpMessageServer)
    {
        this.TcpMessageServer = tcpMessageServer;
    }

    public String getMessageStoreTcpServer()
    {
        return this.MessageStoreTcpServer;
    }

    public void setMessageStoreTcpServer(String messageStoreTcpServer)
    {
        this.MessageStoreTcpServer = messageStoreTcpServer;
    }

    public String getMessageStoreHttpServer()
    {
        return this.MessageStoreHttpServer;
    }

    public void setMessageStoreHttpServer(String messageStoreHttpServer)
    {
        this.MessageStoreHttpServer = messageStoreHttpServer;
    }

    public long getTimeDistance()
    {
        return this.timeDistance;
    }

    public void setTimeDistance(long timeDistance)
    {
        this.timeDistance = timeDistance;
    }

    public boolean equals(Object o)
    {
        if (o instanceof MCToken)
        {
            MCToken token = (MCToken) o;
            if (token != null
                    && token.getApplyInfo().getAppId() == this.getApplyInfo()
                            .getAppId()
                    && token.getApplyInfo().getUserName() == this
                            .getApplyInfo().getUserName())
            {
                return true;
            }
        }

        return false;
    }
}
